<h1>Cases</h1>
<%= render :partial=> 'layouts/datatable'%>
<table id="list_table" cellpadding="5" cellspacing="0" border="2" width="100%">
 <thead>
  <tr>
    <th>Case Num</th>
    <th>Case Status</th>
    <th>Assigned Employee</th>
    <th>Employee Email</th>
	  <th>Client</th>
    <th>Location</th>
   <% if current_employee %>
     <th></th>
     <th></th>
		<% end %>
	 </tr>
 </thead>
<tbody>
<% @cases.each do |cas| %>
  <tr>
			<td><%= cas.case_num %></td>
			<td><%= cas.case_status %></td>
    	<td><%= cas.employee.full_name if !cas.employee.nil?  %></td>
    	<td><%= cas.employee.email if !cas.employee.nil? %></td>
			<td><%= cas.client.full_name if !cas.client.nil?%></td>
    	<td><%= cas.hearing_location %>
   		 <%=link_to (image_tag 'maps.png',:style=>"float:right"), "http://local.google.com/maps?daddr=#{cas.hearing_location}" ,:target =>"_blank" %></td>
		<% if current_employee %>
    	<td><%= link_to 'Show', cas %></td>
  		<td><%= link_to 'Edit', edit_case_path(cas)  %> </td>
		<% end %>
  </tr>
<% end %>
</table>
</tbody>
<br />
